<?php
// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: create by allen.qiang
// +----------------------------------------------------------------------
/**
 * 维权投诉控制器
 * @package  htdocs
 * @subpackage  quanliadmin
 * @author   create by allen.qiang
 */

class pa_billComplain {

    public function execute() {

        if(isset($_REQUEST['operFlg']) && $_REQUEST['operFlg'] > 0 ) {

            switch ($_REQUEST['operFlg']) {

                case 1://维权投诉列表
                    $this->billComplainSearch();
                    break;

                case 2://处理维权投诉
                    $this->dealComplain();
                    break;

                default:
                    backendError();
                    break;

            }
        } else {

            backendError();

        }

    }



    /**
     * 维权投诉列表
     */
    private function billComplainSearch() {

        global $G_PGLOB;

        $G_PGLOB->smarty->display('bill/billComplainList.tpl');

    }


    /**
     *
     * 维权投诉处理
     */
    public function dealComplain(){
        global $G_PGLOB;

        if( !isset($_REQUEST['complain_id']) || !is_numeric($_REQUEST['complain_id'])){
            backendError();
        }
        $arg_array = array(
            'complain_id'=>$_REQUEST['complain_id']
        );

        //引用维权投诉类
        quanli_require('module/base/bill/billComplain.class.php');
        $billComplain = new billComplain();

        $billComplain_array = $billComplain->billComplainSearch( $arg_array );

        if( $billComplain_array ){
            $G_PGLOB->smarty->assign_by_ref('billComplain_array',$billComplain_array[0]);

        }
        $G_PGLOB->smarty->display('bill/dealComplain.tpl');
    }
}
